package ch18._01;

public class Solution {
    public static int add(int a, int b) {
	int carry = a & b;
	int sum = a ^ b;
	while (carry != 0) {
	    b = carry << 1;
	    a = sum ^ b;
	    carry = sum & b;
	    sum = a;
	}
	return sum;
    }
    
    public static void main(String[] args) {
		int a = 
//				Integer.MAX_VALUE
				1
				;
		int b = 
//				Integer.MAX_VALUE
//				Integer.MIN_VALUE
				2000
				;
		int result = add(a, b);
		System.out.println(result);
	}
}